<template>
	<view>
		<scan></scan>
		<scanner></scanner>
		<sm></sm>
		<honeywell></honeywell>
		<u-sticky><u-tabs :list="list" :is-scroll="false" :current="current" @change="sectionChange"></u-tabs></u-sticky>
		<u-card padding="16" v-if="current == 0">
			<view class="" slot="head">
				<view class="wrap">
					<u-row>
						<u-col span="8" text-align="left">
							<view class="u-line-1 u-m-t-2 weikaishi2 lanse">
								<span>源库位</span>
							</view>
						</u-col>
					</u-row>
					<u-row>
						<u-col span="12" text-align="left">
							<view class=" u-m-t-4 weikaishi">
								<span v-html="yuanweizhi"></span>
							</view>
						</u-col>
					</u-row>
				</view>
			</view>
			<view class="" slot="body">
				<view class="wrap">
					<view v-for="(item,index) in dataList" :key="index">
						<u-row>
							<u-col span="2" text-align="center">
								<view class="u-line-1 u-m-t-4 weikaishi">
									<u-icon name="https://z3.ax1x.com/2021/07/19/WJFqj1.png" color="#2b85e4" size="45"></u-icon>
								</view>
							</u-col>
							<u-col span="10" text-align="left">
								<view class="u-m-t-4 lanse weikaishi">
									<span>{{item.goodsNumber}},{{item.goodsName}},{{item.goodsNo}}</span>
								</view>
							</u-col>
						</u-row>
						<u-row>
							<u-col span="5" text-align="center">
								<view class="u-line-1 u-m-t-4 lanse weikaishi">
									<span>库位：</span><span>{{item.positionNumber}}</span>
								</view>
							</u-col>
							<u-col span="7" text-align="center">
								<view class="u-line-1 u-m-t-4 lanse weikaishi">
									<span>批次：</span><span>{{item.goodsbatchs}}</span>
								</view>
							</u-col>
						</u-row>
						<u-row v-for="(item1,index1) in item.list" :key="index1">
							<u-col span="4" text-align="center">
								<view class="u-line-1 u-m-t-4">
									<u-checkbox v-model="item.list[index1].checked">{{item1.trayNumber}}</u-checkbox>
								</view>
							</u-col>
							<u-col span="3" text-align="center">
								<view class="u-line-1 u-m-t-10">
									<span>{{item1.num}}</span>
								</view>
							</u-col>
							<u-col span="5" text-align="center">
								<view class="u-line-1 u-m-t-4">
									<span><u-input v-model="item.list[index1].chunum" type="digit" :border="true" height="50" placeholder="请输入"/></span>
								</view>
							</u-col>
						</u-row>
						<u-row>
							<u-col span="12" text-align="center">
								<view class="jiange">
								</view>
							</u-col>
						</u-row>
					</view>
					<u-row>
						<u-col span="6" text-align="left">
							<view class="u-line-1 u-m-t-8">
								<u-checkbox v-model="arrtray" @change="checkboxarrtray">整托移库</u-checkbox>
							</view>
						</u-col>
					</u-row>
				</view>
			</view>
		</u-card>
		<u-card padding="16" v-if="current == 0">
			<view class="" slot="head">
				<view class="wrap">
					<u-row>
						<u-col span="8" text-align="left">
							<view class="u-line-1 u-m-t-2 weikaishi2 yiwancheng">
								<span>选择目的地</span>
							</view>
						</u-col>
						<u-col span="2" text-align="right" @click="getp2()">
							<view class="u-line-1 u-m-t-2 weikaishi2">
								<u-icon name="plus" color="#00c300" size="43"></u-icon>
							</view>
						</u-col>
						<u-col span="2" text-align="right" @click="canm()">
							<view class="u-line-1 u-m-t-2 weikaishi2">
								<u-icon name="scan" color="#2b85e4" size="43"></u-icon>
							</view>
						</u-col>
					</u-row>
					<u-row>
						<u-col span="12" text-align="right">
							<view class="u-line-1 u-m-t-2" >
								<u-search placeholder="输入目的地" :clearabled="true" v-model="keyword3" border-color="#606266" @custom="search3" @search="search3" @focus="setSearchFocus('destination')"></u-search>
							</view>
						</u-col>
					</u-row>
					<u-row>
						<u-col span="12" text-align="left">
							<view class=" u-m-t-4 weikaishi">
								<span v-html="mudiweizhi"></span>
							</view>
						</u-col>
					</u-row>
				</view>
			</view>
			<view class="" slot="body">
				<view class="wrap">
					<view v-for="(item,index) in dataList2" :key="index">
						<u-row>
							<u-col span="2" text-align="center">
								<view class="u-line-1 u-m-t-5 weikaishi">
									<u-icon name="https://z3.ax1x.com/2021/07/19/WJFqj1.png" color="#2b85e4" size="45"></u-icon>
								</view>
							</u-col>
							<u-col span="10" text-align="left">
								<view class="u-m-t-4 lanse weikaishi">
									<span>{{item.goodsNumber}},{{item.goodsName}},{{item.goodsNo}}</span>
								</view>
							</u-col>
						</u-row>
						<u-row>
							<u-col span="8" text-align="center">
								<view class="u-line-1 u-m-t-4 lanse weikaishi">
									<span>批次：</span><span>{{item.goodsbatchs}}</span>
								</view>
							</u-col>
						</u-row>
						<u-row v-for="(item1,index1) in item.list" :key="index1">
							<u-col span="6" text-align="center">
								<view class=" u-m-t-4">
									<u-checkbox v-model="item.list[index1].checked" @change="checkboxChange(item1)">{{item1.trayNumber}}</u-checkbox>
								</view>
							</u-col>
							<u-col span="4" text-align="center">
								<view class="u-line-1 u-m-t-10">
									<span>{{item1.num}}</span>
								</view>
							</u-col>
						</u-row>
						<u-row>
							<u-col span="12" text-align="center">
								<view class="jiange">
								</view>
							</u-col>
						</u-row>
					</view>
					<u-row>
						<u-col span="6" text-align="left">
							<view class="u-line-1 u-m-t-8">
								<u-checkbox v-model="newtray" @change="checkboxNewtray">添加新托盘</u-checkbox>
							</view>
						</u-col>
					</u-row>
				</view>
			</view>
		</u-card>
		
		<u-card padding="16" v-if="current == 1" v-for="item in cxlist" :key="item.id">
			<view class="" slot="head">
				<view class="wrap">
					<u-row>
						<u-col span="6" text-align="left">
							<view class="u-line-1 u-m-t-2 weikaishi3">
								<span>{{item.typr}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row>
						<u-col span="7" text-align="left">
							<view class="u-line-1 u-m-t-2 weikaishi">
								<span>{{item.createTime}}</span>
							</view>
						</u-col>
						<u-col span="5" text-align="right">
							<view class="u-line-1 u-m-t-2 weikaishi">
								<span>操作人：{{item.nodes}}</span>
							</view>
						</u-col>
					</u-row>
				</view>
			</view>
			<view class="" slot="body">
				<view class="wrap">
					<u-row>
						<u-col span="2" text-align="center">
							<view class="u-line-1 u-m-t-4 weikaishi">
								<u-icon name="https://z3.ax1x.com/2021/07/19/WJFqj1.png" color="#2b85e4" size="45"></u-icon>
							</view>
						</u-col>
						<u-col span="10" text-align="left">
							<view class="u-m-t-4 lanse weikaishi">
								<span>{{item.goodsNumber}},{{item.goodsName}},{{item.goodsNo}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row>
						<u-col span="6" text-align="left">
							<view class="u-line-1 u-m-t-4 lanse weikaishi">
								<span>源库位：</span><span>{{item.sourcepositionNumber}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row>
						<u-col span="6" text-align="left">
							<view class="u-line-1 u-m-t-4">
								<span>托号：</span><span>{{item.sourcetrayNumber}}</span>
							</view>
						</u-col>
						<u-col span="6" text-align="right">
							<view class="u-line-1 u-m-t-4">
								<span>数量：</span><span>-{{item.sourcenum}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row>
						<u-col span="6" text-align="left">
							<view class="u-line-1 u-m-t-4 yiwancheng weikaishi">
								<span>目的地：</span><span>{{item.aimpositionNumber}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row>
						<u-col span="6" text-align="left">
							<view class="u-line-1 u-m-t-4">
								<span>托号：</span><span>{{item.aimtrayNumber}}</span>
							</view>
						</u-col>
						<u-col span="6" text-align="right">
							<view class="u-line-1 u-m-t-4">
								<span>数量：</span><span>+{{item.aimnum}}</span>
							</view>
						</u-col>
					</u-row>
				</view>
			</view>
		</u-card>
		
		<view style="height: 90rpx;" v-if="current == 0">
		</view>
		
		<view v-if="current == 0" class="wrap" style="position: fixed;bottom: 0rpx;width: 100%;background-color: #2979ff;z-index: 999;" @click="queren()">
			<u-line color="#bababa"/>
			<u-row>
				<u-col span="12" text-align="center">
					<view class="u-line-1 u-m-t-10 baise">
						确定
					</view>
				</u-col>
			</u-row>
			<u-row>
			</u-row>
		</view>
		
		<view>
			<u-select v-model="popupShow3" :list="plist" @confirm="confirm"></u-select>
			<!-- mode="mutil-column-auto" -->
		</view>
		<u-popup v-model="popupShow2" mode="center" closeable width="550rpx" height="600rpx" border-radius="10">
			<view class=" u-p-r-30 u-p-l-30 u-m-t-20" style="margin-top: 40rpx;">
				<u-search placeholder="输入商品编号/名称/货号搜索" :clearabled="true" v-model="keyword" border-color="#606266" @custom="search" @search="search"></u-search>
			</view>
			<view class="wrap">
				<u-row v-for="(item,index) in glist" :key="index" @click="xuanzegoods(item)">
					<u-col span="12" text-align="center">
						<view class="u-m-t-10 weikaishi lanse">
							<span>{{item.goodsNumber}},{{item.goodsName}},{{item.goodsNo}}</span>
						</view>
					</u-col>
				</u-row>
			</view>
		</u-popup>
		<view>
			<u-toast ref="uToast" />
		</view>
	</view>
</template>

<script>
	
	import scan from "@/components/uni-scan/scan.vue"
	import scanner from "@/components/uni-scan/scanner.vue"
	import sm from "@/components/uni-scan/sm.vue"
	import honeywell from "@/components/uni-scan/honeywell.vue"
	export default {
		components: {
			scanner,
			scan,
			sm,
			honeywell
		},
		data() {
			return {
				list: [
					{
						name: '移库合托'
					}, 
					{
						name: '操作记录'
					},
				],
				current: 0,
				dataList:[],
				dataList2:[],
				arrtray:false,
				newtray:false,
				plist:[],
				glist:[],
				bhData:{},
				popupShow2:false,
				popupShow3:false,
				
				selectType:'',
				yuanweizhi:'',
				mudiweizhi:'',
				yuanpositionId:'',
				mudipositionId:'',
				cxlist:[],
			    pageNo: 1,
			    hasMore: true,
			    orderCount: 0,
				
				keyword:'',
				goodsId:'',
				keyword2:'',
				keyword3:'',
			};
		},
		onLoad(open) {
			console.log(open.id);
			if(open.id){
				//获取补货单信息 原库存ID，以及数量
				this.$http.post('/rest/bh/getById',{
				},{
					params: {
						id:open.id
					},
					header: {
						'Authorization' :uni.getStorageSync('token'),
					}
				}).then(res => {
					this.bhData = res.data.data;
					console.log(this.bhData)
					uni.showLoading({
						title: '加载中'
					})
					this.$http.post('/rest/movesupport/listById',{
					},{
						params: {
							id:this.bhData.storeId,
						},
						header: {
							'Authorization' :uni.getStorageSync('token'),
						}
					}).then(res => {
						uni.hideLoading()
						this.dataList = res.data.data
						if(this.dataList.length > 0 ){
							this.dataList[0].list[0].chunum = this.bhData.numb;
							this.dataList[0].list[0].checked = true;
							
							
							console.log(this.dataList)
							//推荐储位
							this.$http.post('/rest/storage/getRecommendWarehouselist',{
							},{
								params: {
									goodsNumber:this.dataList[0].goodsNumber,
									warehouseId:this.dataList[0].warehouseId
								},
								header: {
									'Authorization' :uni.getStorageSync('token'),
								}
							}).then(res => {
								this.plist = res.data.data
								console.log(this.plist)
							})
							
						}
						
						
					})
					
					this.keyword3 = this.bhData.jpositionNumber;
					this.search3();
				})
			}
			
		},
		onShow() {
		  // 先移除已存在的监听器
		  uni.$off('scan');
		  uni.$off('scanner');
		  uni.$off('sm');
		  uni.$off('honeywell');
		
		  // 再添加新的监听器
		  uni.$on('scan', (res) => {
		    console.log('扫码结果1：', res.codeStr);
		    this.handleScanResult(res.codeStr);
		  });
		
		  uni.$on('scanner', (res) => {
		    console.log('扫码结果2：', res.code);
		    this.handleScanResult(res.code);
		  });
		
		  uni.$on('sm', (res) => {
		    console.log('扫码结果3：', res.code);
		    this.handleScanResult(res.code);
		  });
		
		  uni.$on('honeywell', (res) => {
		    console.log('扫码结果4：', res.code);
		    this.handleScanResult(res.code);
		  });
		},
		onHide() {
		  // 移除所有全局事件监听器
		  uni.$off('scan');
		  uni.$off('scanner');
		  uni.$off('sm');
		  uni.$off('honeywell');
		},
		onPullDownRefresh() {
			if(this.current == 1){
				this.refresh2()
			}
			uni.stopPullDownRefresh()
		},
		onReachBottom() {
			if(this.current == 1){
				uni.showLoading({
					title: '加载中'
				})
				if (this.hasMore) {
					this.pageNo++ 
					setTimeout(() => {
						this.loadOrder({
						}).then(res => {})
						uni.hideLoading()
					}, 500)
				} else {
					setTimeout(() => {
						uni.hideLoading()
						uni.showToast({
							icon: 'none',
							title: '已经到低了哦',
							duration: 2000
						});
					}, 500)
				}
			}
		},
		methods:{
			cany(){
				let that = this
				// 只允许通过相机扫码
				uni.scanCode({
					success: function (res) {
						console.log('条码类型：' + res.scanType);
						console.log('条码内容：' + res.result);
						that.keyword2 = res.result
						that.search2()
					}
				});
			},
			canm(){
				let that = this
				// 只允许通过相机扫码
				uni.scanCode({
					success: function (res) {
						console.log('条码类型：' + res.scanType);
						console.log('条码内容：' + res.result);
						that.keyword3 = res.result
						that.search3()
					}
				});
			},
			xuanzegoods(item){
				this.yuanweizhi = ''
				this.yuanpositionId = ''
				this.keyword2 = ''
				this.goodsId = item.id
				uni.showLoading({
					title: '加载中'
				})
				this.$http.post('/rest/movesupport/list',{
				},{
					params: {
						goodsId:item.id,
					},
					header: {
						'Authorization' :uni.getStorageSync('token'),
					}
				}).then(res => {
					uni.hideLoading()
					this.dataList = res.data.data
					this.popupShow2 = false
				})
			},
			search(){
				this.$http.post('/rest/storage/goodslist',{
				},{
					params: {
						condition:this.keyword
					},
					header: {
						'Authorization' :uni.getStorageSync('token'),
					}
				}).then(res => {
					let arr = []
					let inta = 0
					for(let item1 of res.data.data) {
						if(inta != 10){
							arr.push(item1)
						} else {
							break
						}
						inta++
					}
					this.glist = arr
					this.popupShow2 = true
				})
			},
			search3(){
				if(typeof this.keyword3 == 'undefined' || this.keyword3 == null || this.keyword3 == ""){
					uni.showToast({
						title: "请输入目的地",
						icon: 'none'
					})
					return
				}
				this.mudipositionId = ''
				this.keyword3 = this.keyword3.toLocaleUpperCase()
				this.mudiweizhi = '目的地：'+this.keyword3
				uni.showLoading({
					title: '加载中'
				})
				this.$http.post('/rest/movesupport/list',{
				},{
					params: {
						positionNumber:this.keyword3.toLocaleUpperCase(),
					},
					header: {
						'Authorization' :uni.getStorageSync('token'),
					}
				}).then(res => {
					console.log(123123)
					console.log(res)
					uni.hideLoading()
					this.dataList2 = res.data.data
					for(let item1 of res.data.data) {
						this.mudipositionId = item1.positionId
					}
				})
			},
			search2(){
				if(typeof this.keyword2 == 'undefined' || this.keyword2 == null || this.keyword2 == ""){
					uni.showToast({
						title: "请输入源库位",
						icon: 'none'
					})
					return
				}
				this.yuanpositionId = ''
				this.keyword = ''
				this.goodsId = ''
				this.keyword2 = this.keyword2.toLocaleUpperCase()
				this.yuanweizhi = '源：'+this.keyword2
				uni.showLoading({
					title: '加载中'
				})
				this.$http.post('/rest/movesupport/list',{
				},{
					params: {
						positionNumber:this.keyword2.toLocaleUpperCase(),
					},
					header: {
						'Authorization' :uni.getStorageSync('token'),
					}
				}).then(res => {
					uni.hideLoading()
					this.dataList = res.data.data
					for(let item1 of res.data.data) {
						this.yuanpositionId = item1.positionId
					}
				})
			},
			refresh2(){
				this.pageNo = 1
				this.hasMore = true
				this.loadOrder({
				}).then(res => {
				})
			},
			loadOrder(param = {}) {
				return new Promise((resolve, reject) => {
					param = Object.assign(param, {
						page: this.pageNo,
						limit: 10
					})
					this.$http.post('/rest/movesupport/cxlist',{
					},{
						params: param,
						header: {
							'Authorization' :uni.getStorageSync('token'),
						}
					}).then(res => {
						if (this.pageNo == 1) {
							this.cxlist = res.data.data
						} else {
							this.cxlist = this.cxlist.concat(res.data.data)
						}
						this.orderCount = res.data.count
						this.hasMore = this.pageNo * 10 < res.data.count
						resolve(res)
					})
				})
			},
			checkboxChange(item){
				this.newtray = false
				for(let item1 of this.dataList2) {
					for(let item2 of item1.list) {
						if(item2.id != item.id){
							item2.checked = false
						}
					}
				}
			},
			refresh(){
				this.arrtray = false
				this.newtray = false
				this.$http.post('/rest/movesupport/list',{
				},{
					params: {
						positionId:this.yuanpositionId,
						positionNumber:this.keyword2.toLocaleUpperCase(),
						goodsId:this.goodsId
					},
					header: {
						'Authorization' :uni.getStorageSync('token'),
					}
				}).then(res => {
					this.dataList = res.data.data
				})
				this.$http.post('/rest/movesupport/list',{
				},{
					params: {
						positionId:this.mudipositionId,
						positionNumber:this.keyword3.toLocaleUpperCase()
					},
					header: {
						'Authorization' :uni.getStorageSync('token'),
					}
				}).then(res => {
					this.dataList2 = res.data.data
				})
			},
			queren(){
				if(this.mudipositionId == '' && this.keyword3 == ''){
					uni.showToast({
						title: "请选择目的地库位",
						icon: 'none'
					})
					return
				}
				if(this.dataList.length == 0){
					uni.showToast({
						title: "源库位暂无库存",
						icon: 'none'
					})
					return
				}
				let _idlist = []
				let _numlist = []
				for(let item1 of this.dataList) {
					for(let item2 of item1.list) {
						if(item2.checked){
							_idlist.push(item2.id)
							_numlist.push(item2.chunum)
						}
					}
				}
				if(_idlist.length == 0){
					uni.showToast({
						title: "请选择源库存",
						icon: 'none'
					})
					return
				}
				if(!this.arrtray){//整托
					let flag = true
					for(let item1 of this.dataList) {
						for(let item2 of item1.list) {
							if(item2.checked){
								if(item2.chunum == '' || item2.chunum == null){
									flag = false
								}
							}
						}
					}
					if(!flag){
						uni.showToast({
							title: "请输入移出数",
							icon: 'none'
						})
						return
					}
				}
				let aimid = ''
				if(!this.newtray && !this.arrtray){
					for(let item1 of this.dataList2) {
						for(let item2 of item1.list) {
							if(item2.checked){
								aimid = item2.id
							}
						}
					}
					if(aimid == ''){
						uni.showToast({
							title: "请选择目的托盘",
							icon: 'none'
						})
						return
					}
					for(let id of _idlist) {
						if(id == aimid){
							uni.showToast({
								title: "源托盘和目的地不可一致",
								icon: 'none'
							})
							return
						}
					}
				}
				uni.showModal({
					content: '确定提交吗？',
					success: (res) => {
						if (res.confirm) {
							uni.showLoading({
								title: '正在提交'
							})
							if(this.arrtray){//移库
								this.$http.post('/rest/movesupport/remove?ids='+_idlist,{
								},{
									params: {
										aimpositionId:this.mudipositionId,
										aimpositionNumber:this.keyword3
									},
									header: {
										'Authorization' :uni.getStorageSync('token'),
									}
								}).then(res => {
									uni.hideLoading()
									if(res.data.code == 200) {
										this.$refs.uToast.show({
											title: '操作成功',
											type: 'success'
										})
										this.updateReplenish()
										// this.refresh()
									} else {
										this.$refs.uToast.show({
											title: res.data.message,
											type: 'error'
										})
									}
								})
							} else if (this.newtray){//添加新托盘
								this.$http.post('/rest/movesupport/executenew?_idlist='+_idlist+'&_numlist='+_numlist,{
								},{
									params: {
										aimpositionId:this.mudipositionId,
										aimpositionNumber:this.keyword3
									},
									header: {
										'Authorization' :uni.getStorageSync('token'),
									}
								}).then(res => {
									uni.hideLoading()
									if(res.data.code == 200) {
										this.$refs.uToast.show({
											title: '操作成功',
											type: 'success'
										})
										this.updateReplenish()
										// this.refresh()
									} else {
										this.$refs.uToast.show({
											title: res.data.message,
											type: 'error'
										})
									}
								})
							} else {//合托
								this.$http.post('/rest/movesupport/executenonew2?_idlist='+_idlist+'&_numlist='+_numlist,{
								},{
									params: {
										aimid:aimid
									},
									header: {
										'Authorization' :uni.getStorageSync('token'),
									}
								}).then(res => {
									uni.hideLoading()
									if(res.data.code == 200) {
										this.$refs.uToast.show({
											title: '操作成功',
											type: 'success'
										})
										this.updateReplenish()
										// this.refresh()
									} else {
										this.$refs.uToast.show({
											title: res.data.message,
											type: 'error'
										})
									}
								})
							}
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				})
			},
			checkboxarrtray(e){
				if(e.value){
					if(this.newtray){
						uni.showToast({
							title: "整托移库与添加新托盘不能同时选择",
							icon: 'none'
						})
						setTimeout(() => {
							this.arrtray = false
						}, 500)
						return
					}
					if(this.dataList.length == 0){
						uni.showToast({
							title: "请选择源库位库存",
							icon: 'none'
						})
						setTimeout(() => {
							this.arrtray = false
						}, 500)
						return
					}
				}
			},
			checkboxNewtray(e){
				if(e.value){
					if(this.arrtray){
						uni.showToast({
							title: "整托移库与添加新托盘不能同时选择",
							icon: 'none'
						})
						setTimeout(() => {
							this.newtray = false
						}, 500)
						return
					}
					if(this.mudiweizhi == '' && this.keyword3 == ''){
						uni.showToast({
							title: "请选择目的地库位",
							icon: 'none'
						})
						setTimeout(() => {
							this.newtray = false
						}, 500)
						return
					}
					if(this.dataList2.length > 0){
						for(let item1 of this.dataList2) {
							for(let item2 of item1.list) {
								item2.checked = false
							}
						}
					} 
				}
			},
			getp(){
				this.selectType = 'yuan'
				this.popupShow3 = true
			},
			getp2(){
				this.selectType = 'mudi'
				this.popupShow3 = true
			},
			confirm(e) {
				console.log(e)
				console.log(this.selectType)
				if(this.selectType == 'yuan'){
					this.yuanpositionId = e[2].value
					this.keyword2 = ''
					this.keyword = ''
					this.goodsId = ''
					this.yuanweizhi = '源：'+e[0].label+e[1].label+e[2].label
					this.$http.post('/rest/movesupport/list',{
					},{
						params: {
							positionId:e[2].value,
						},
						header: {
							'Authorization' :uni.getStorageSync('token'),
						}
					}).then(res => {
						this.dataList = res.data.data
					})
				} else {
					this.mudipositionId = e[0].value
					this.keyword3 = ''
					this.mudiweizhi = '目的地：'+e[0].label
					this.$http.post('/rest/movesupport/list',{
					},{
						params: {
							positionId:e[0].value,
						},
						header: {
							'Authorization' :uni.getStorageSync('token'),
						}
					}).then(res => {
						this.dataList2 = res.data.data
					})
				}
				this.popupShow3 = false
			},
			sectionChange(e){
				this.current = e
				if(e == 1){
					this.refresh2()
				}
			},
			updateReplenish(){
				this.$http.post('/rest/bh/updateReplenish',{
				},{
					params: {
						id:this.bhData.id,
					},
					header: {
						'Authorization' :uni.getStorageSync('token'),
					}
				}).then(res => {
					// this.dataList = res.data.data
					this.$Router.push({
						name: 'bh'
					})
				})
			},
			setSearchFocus(focusType) {
				this.searchFocus = focusType
			},
			handleScanResult(result) {
			    this.keyword3 = result;
			    this.search3();
			}
		}
	}
</script>
<style lang="scss">
	.u-body-item {
		padding: 20rpx 15rpx;
	}
	.wrap {
		padding: 0rpx 12rpx;
	}
	.u-row {
		margin: 10rpx 2rpx;
	}
	.weikaishi2{
		font-size: 34rpx;
	}
	.baise{
		color: #ffffff;
		font-size: 34rpx;
	}
	.weikaishi3{
		font-size: 30rpx;
	}
	.jiange{
		border-bottom: 1px solid #e1e1e1;
	}
</style>
